package com.ry.demo.concurrent.demo;

/**
 * @Author: lihui
 * @Date: 2021-12-13 09:07
 * @Description:
 */
public class ThreadLocalDemo {

    public static void main(String[] args) {
        ThreadLocal<Long> threadLocal1 = new ThreadLocal<>();
        ThreadLocal<String> threadLocal2 = new ThreadLocal<>();


        // 此时都是main线程，那么main线程中就会有一个`ThreadLocalMap`，

        threadLocal1.set(1L);
        threadLocal2.set("aa");
    }

}
